<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<p:dialog width="800" height="500" header="Cadastrar cliente" widgetVar="clienteEditarDlg" modal="true">
		<h:form id="formClienteEditar">

			<p:menubar style="border:none !important;">
				<p:menuitem value="Salvar" icon="icon-save" style="border: 1px solid #4FBCEA;" actionListener="#{clienteCtrl.salvar}" update=":formClienteListarDlg, :formClienteEditar"/>
				<p:menuitem value="Fechar" icon="icon-cancel" style="border: 1px solid #4FBCEA;" oncomplete="PF('clienteEditarDlg').hide()"/>
			</p:menubar>
						
			<p:spacer width="5" />
			
			<p:panel header="Dados do cliente">
				<h:panelGrid style="width:100% !important;">
					<h:panelGrid columns="2"  columnClasses="label16Perc,value84Perc" style="width:100% !important;">
						<h:outputText value="Nome:" />
						<p:inputText value="#{clienteCtrl.cliente.nmCliente}" maxlength="150" size="63"/>
					</h:panelGrid>
					<h:panelGrid columns="2"  columnClasses="label16Perc,value84Perc" style="width:100% !important;">
						<h:outputText value="RG:"/>
						<p:inputText value="#{clienteCtrl.cliente.nrRg}" maxlength="30"/>
					</h:panelGrid>
					
					<h:panelGrid columns="2"  style="width:100% !important;" >
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="CPF:"/>
							<p:inputMask value="#{clienteCtrl.cliente.nrCpf}" mask="999.999.999-99"/>
						</h:panelGrid>
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="CNPJ:"/>
							<p:inputMask value="#{clienteCtrl.cliente.nrCnpj}" mask="99.999.999/9999-99"/>
						</h:panelGrid>
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="Residencial:"/>
							<p:inputMask value="#{clienteCtrl.cliente.nrTelefoneResidencial}" mask="(99) 9999-9999"/>
						</h:panelGrid>
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="Celular:"/>
							<p:inputMask value="#{clienteCtrl.cliente.nrTelefoneCelular}" mask="(99) 9999-9999"/>
						</h:panelGrid>
					</h:panelGrid>
				</h:panelGrid>
			</p:panel>
			
			<p:spacer width="5" />
			
			<p:panel header="Endereco">
				<h:panelGrid style="width:100% !important;" >
					<h:panelGrid columns="2" style="width:100% !important;">
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="Estado:"/>
							<p:selectOneMenu id="fkEstado" value="#{clienteCtrl.cliente.estado.cdId}" style="width:218px;">
								<f:selectItems value="#{clienteCtrl.selectItemEstado}"/>
								<p:ajax event="change" process="@parent" update="fkCidade"/>
							</p:selectOneMenu>
						</h:panelGrid>
						<h:panelGrid columns="2"  columnClasses="label30Perc,value70Perc" style="width:100% !important;">
							<h:outputText value="Cidade:"/>
							<p:selectOneMenu id="fkCidade" value="#{clienteCtrl.cliente.cidade.cdId}" style="width:186px;">
								<f:selectItems value="#{clienteCtrl.selectItemCidade}"/>
							</p:selectOneMenu>
						</h:panelGrid>
					</h:panelGrid>
					<h:panelGrid columns="2"  columnClasses="label16Perc,value84Perc" style="width:100% !important;">
						<h:outputText value="Rua:"/>
						<p:inputText value="#{clienteCtrl.cliente.dsRua}" maxlength="500" size="61"/>
					</h:panelGrid>
					<h:panelGrid columns="2"  columnClasses="label16Perc,value84Perc" style="width:100% !important;">
						<h:outputText value="Numero:"/>
						<p:inputText value="#{clienteCtrl.cliente.nrEndereco}"  maxlength="10" size="10"/>
					</h:panelGrid>
					<h:panelGrid columns="2"  columnClasses="label16Perc,value84Perc" style="width:100% !important;">
						<h:outputText value="Complemento:"/>
						<p:inputText value="#{clienteCtrl.cliente.dsComplemento}"  maxlength="255" size="61"/>
					</h:panelGrid>
				</h:panelGrid>
			</p:panel>
			

		</h:form>
	</p:dialog>

</ui:composition>